﻿namespace GerbilLib
{
    /// <summary>
    /// Set of title matching options used to manipulate how MediaGerbil matches
    /// title strings. Typically stored in a Preferences object.
    /// </summary>
    public class TitleMatchingOptions
    {
        /// <summary>
        /// Enumeration of Title Match Sources for offline matching
        /// </summary>
        public enum TitleMatchSources { None, MpaaRatings, ImdbRatings, FullMovieList }
        /// <summary>
        /// Enumeration of Sort Options for faster or more accurate matching
        /// </summary>
        public enum TitleSortOptions { StopAtFirstMatch, SortByPosition, SortByLevenshtein }

        /// <summary>
        /// Gets or sets the title match source.
        /// </summary>
        /// <value>
        /// The title match source.
        /// </value>
        public TitleMatchSources TitleMatchSource { get; set; }
        /// <summary>
        /// Gets or sets the title sort option.
        /// </summary>
        /// <value>
        /// The title sort option.
        /// </value>
        public TitleSortOptions TitleSortOption { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether to sort by newer year.
        /// </summary>
        /// <value>
        ///   <c>true</c> to sort by newer year; otherwise, <c>false</c>.
        /// </value>
        public bool SortByNewerYear { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether to use the year in the file path.
        /// </summary>
        /// <value>
        ///   <c>true</c> to use the year in the file path; otherwise, <c>false</c>.
        /// </value>
        public bool UseYearInPath { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether to use the year in the parent directory only.
        /// </summary>
        /// <value>
        /// 	<c>true</c> to use the year in the parent directory only; otherwise, <c>false</c>.
        /// </value>
        public bool UseYearInParentOnly { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="TitleMatchingOptions"/> class.
        /// </summary>
        public TitleMatchingOptions()
        {
            // Needed for XmlSerializer
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TitleMatchingOptions"/> class.
        /// </summary>
        /// <param name="titleMatchSource">The title match source.</param>
        /// <param name="titleSortOption">The title sort option.</param>
        /// <param name="sortByNewerYear">if set to <c>true</c> sort by newer year.</param>
        /// <param name="useYearInPath">if set to <c>true</c> use year in path.</param>
        /// <param name="useYearInParentOnly">if set to <c>true</c> use year in parent directory only.</param>
        public TitleMatchingOptions(TitleMatchSources titleMatchSource, TitleSortOptions titleSortOption, bool sortByNewerYear, bool useYearInPath, bool useYearInParentOnly)
            : this()
        {
            TitleMatchSource = titleMatchSource;
            TitleSortOption = titleSortOption;
            SortByNewerYear = sortByNewerYear;
            UseYearInPath = useYearInPath;
            UseYearInParentOnly = useYearInParentOnly;
        }
    }
}
